package com.sdu.passager.main;

import java.sql.SQLException;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.sdu.passager.utils.CodeGen;


public class CodeGenMain {

	private static final String APP_LOCATION = "/conf/applicationContext.xml";

	private static ApplicationContext cTools = null;

	private static final String[] locations = { APP_LOCATION };

	//
	/**
	 * @description:获得配置文件的bean
	 * @author: leel Jul 5, 2012 8:38:22 AM
	 * 
	 * @param name
	 * @return Object
	 */
	public static Object getBean(String name) {
		if (cTools == null) {
			cTools = new ClassPathXmlApplicationContext(locations);
		}
		return cTools.getBean(name);
	}
	
	/**
	 * @param args
	 * @throws SQLException 
	 */
	public static void main(String[] args) throws SQLException {
		CodeGen cg  = (CodeGen)getBean("codeGen");
		cg.fltCodeGen();
	}


}
